package com.kuang.user.controller;

import com.kuang.bascic.utils.AjaxResult;
import com.kuang.user.domian.User;
import com.kuang.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @PostMapping("/checkPhone")
    public AjaxResult loadcheckPhone(@RequestBody Map<String,String> map){
        User user = userService.checkPhoneL(map.get("phone"));
        if (user!=null){
            // 说明注册了
            return AjaxResult.me().setMessage("注册过了");
        }else{
            return AjaxResult.me();
        }
    }

}

